<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" ></meta>
	<title>电商管理系统</title>
	<link rel="stylesheet" type="text/css" th:href="@{/common/css/index.css}" />
	<link rel="stylesheet" type="text/css" th:href="@{/homePage/css/default.css}" />
	<link rel="stylesheet" type="text/css" th:href="@{/homePage/js/themes/default/easyui.css}" />
	<link rel="stylesheet" type="text/css" th:href="@{/homePage/js/themes/icon.css}" />
	<script type="text/javascript" th:src="@{/homePage/js/jquery-1.4.4.min.js}"></script>
	<script type="text/javascript" th:src="@{/homePage/js/jquery.easyui.min.1.2.2.js}"></script>
	<script type="text/javascript" th:src='@{/homePage/js/outlook2.js?v=20160406001}'> </script>
<script th:inline="javascript">

$(function() {
	$('#editWin').window({
		    title : '修改密码',
			width : 300,
			modal : true,
			shadow : true,
			closed : true,
			height : 160,
			resizable : false});
});
function openPwd() {	
	$('#editWin').window('open');
}
//关闭登录窗口
function closePwd() {
	$('#editWin').window('close');
}
//修改密码
function serverLogin() {
	
	var _newpass = $('#txtNewPass').val(),
        _rePass = $('#txtRePass').val();

	if (!_newpass) {
		msgShow('系统提示', '请输入密码！', 'warning');
		return false;
	}
	
	if (!_rePass) {
		msgShow('系统提示', '请在一次输入密码！', 'warning');
		return false;
	}
	if (_newpass.length<6) {
		msgShow('系统提示', '密码至少六位或以上！', 'warning');
		return false;
	}
	if (_newpass != _rePass) {
		msgShow('系统提示', '两次密码不一至！请重新输入', 'warning');
		return false;
	}

	$.post('${dynamicURL}/basic/userInfoAction!editPassword.do?password='+_newpass, function(msg) {

		msgShow('系统提示', '恭喜，密码修改成功！', 'info');
		
		$('#txtNewPass').val('');
		$('#txtRePass').val('');
		
		closePwd();
	});
}
function _logout(){//退出
	
	$.messager.confirm('系统提示', '您确定要退出系统?', function(r) {
		if (r) {
			location.href = [[@{/login/logout}]];
		}
	});
}
</script>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
	<div region="north" split="true" border="false" th:style="'overflow: hidden; height: 49px; background: url('+@{/homePage/images/layout-browser-hd-bg.jpg}+') #A8D6F7 no-repeat; line-height:40px; color: #fff; font-family: Verdana, 微软雅黑, 黑体'">
		<div class="head-body">
			<span style="padding-left: 10px;font-size: 21px;color:black;">
				<img src="../common/img/blocks.jpg" width="35" height="32" align="absmiddle" /> 
				&nbsp;&nbsp;微众
			</span>
			<div class="head-body-b">
               <div class="head-body-b-float">
	               <div class="b-button-01">
	                   <div class="button-left">&nbsp;</div>
	                   <div class="button-right">&nbsp;</div>
	                   <a href="#">
	                   	<div class="button-bg">
	                         <span class="bg" th:text="${session._user_nick_name}" ></span>
	                   	</div>
	                   </a>
	               </div>
	               <div class="b-button-01 b-button-02" style="width:80px;">
	                   <div class="button-left">&nbsp;</div>
	                   <div class="button-right">&nbsp;</div>
	                   <a href="javascript:;" onclick="openPwd()"><div class="button-bg">
	                         <span class="bg-01">修改密码</span>
	                   </div></a>
	               </div>
	               <div class="b-button-01 b-button-02">
	                   <div class="button-left">&nbsp;</div>
	                   <div class="button-right">&nbsp;</div>
	                   <a href="#" onclick="_logout();"><div class="button-bg">
	                         <span class="bg-02">退出</span>
	                   </div></a>
	               </div>
               </div>
	         </div>		 
		</div>	
	</div>
	
	<!-- 尾线 -->
	<div region="south" split="true" style="height: 20px; background: #D2E0F2;"></div>
	
	<div region="west" hide="true" split="true" title="导航菜单" style="width: 180px;" id="west" border="false">
		<div id="nav" class="easyui-accordion" fit="true" border="false">
			<div th:each="resource,iterStat : ${resourceMap}" th:title="${resource.key.name}" th:icon="'icon '+${resource.key.imgName}">
				 <ul>
				 	<li>
				 		<div th:each="child: ${resource.value}">
				 			<a href="#" th:rel="@{${child.url}}" >
	                      		<span th:class="'icon '+${child.imgName}" >&nbsp;</span>
	                      		<span class="nav" style="font-weight: bolder;" th:text="${child.name}"></span>
	                      	</a>
				 		</div>
				 	</li>
				 </ul>
			</div>
		</div>
	</div>
	
	<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden" border="false">
		<div id="tabs" class="easyui-tabs" fit="true" >
			<div title="公告" style="padding: 20px; overflow: hidden;"></div>
		</div>
	</div>

	<!--修改密码窗口-->
	<div id="editWin" class="easyui-window" title="修改密码" collapsible="false" minimizable="false" maximizable="false" icon="icon-save"
		style="width: 300px; height: 150px; padding: 5px; background: #fafafa;">
		<div class="easyui-layout" fit="true">
			<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
				<table cellpadding=3>
					<tr>
						<td>新密码：</td>
						<td><input id="txtNewPass" type="Password" class="txt01" /></td>
					</tr>
					<tr>
						<td>确认密码：</td>
						<td><input id="txtRePass" type="Password" class="txt01" /></td>
					</tr>
				</table>
			</div>
			<div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
				<a class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" onclick="serverLogin();"> 确定</a> 
				<a class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)" onclick="closePwd();">取消</a>
			</div>
		</div>
	</div>

	<div id="mm" class="easyui-menu" style="width: 150px;">
		<div id="mm-tabupdate">刷新</div>
		<div class="menu-sep"></div>
		<div id="mm-tabclose">关闭</div>
		<div id="mm-tabcloseall">全部关闭</div>
		<div id="mm-tabcloseother">除此之外全部关闭</div>
		<div class="menu-sep"></div>
		<div id="mm-tabcloseright">当前页右侧全部关闭</div>
		<div id="mm-tabcloseleft">当前页左侧全部关闭</div>
		<div class="menu-sep"></div>
		<div id="mm-exit">退出</div>
	</div>
</body>
</html>